home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Pane2 / c / OpenWindow < prev    next >
Text File  |  1995-08-23  |  2KB  |  59 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Pane2.OpenWindow.c
  12.     Author:  Copyright © 1995 Andrew Sellors.
  13.     Version: 1.04 (4th August 1995)
  14.     Purpose: Handles windows with panes.
  15. */
  16.  
  17. #include "DeskLib:Pane2.h"
  18. #include "Pane2Defs.h"
  19. #include "Desklib:Event.h"
  20. #include "DeskLib:Template.h"
  21. #include "Desklib:EventMsg.h"
  22. #include "Desklib:Error.h"
  23.  
  24. #include <stdlib.h>
  25.  
  26.  
  27. /******************************************************************************/
  28.  
  29. extern BOOL Pane2_OpenWindow(window_handle mainwindow, window_openblock *openblock)
  30. {
  31.  /*
  32.   * Calls Wimp_OpenWindow for the mainwindow and all its panes as if it was
  33.   * send an openwindow request.
  34.   * If 'openblock' is NULL then the current state of the main window is used.
  35.   * Supplying an openblock allows the main window to be changed and the panes to be
  36.   * altered to match.
  37.   * Can be used to make a pane window appear that has been added to an open mainwindow.
  38.   */
  39.   main_listelement *mainelement;
  40.   window_state mainstate;
  41.  
  42.  /*
  43.   * find element for main window and return NULL if mainwindow not present
  44.   */
  45.   mainelement = FindMainWindow(mainwindow);
  46.   if(mainelement == NULL)
  47.      return(FALSE); /* not found */
  48.  
  49.  /*
  50.   * read main window state if openblock not supplied
  51.   */
  52.   if(openblock == NULL){
  53.      Wimp_GetWindowState(mainwindow, &mainstate);
  54.      openblock = &(mainstate.openblock);
  55.   }
  56.  
  57.   return(OpenWindow(openblock, mainelement));
  58. }
  59.